package com.io;

import org.apache.commons.io.IOUtils;

import java.io.*;

public class OutputStreaTest {
    public static void main(String[] args) {
        File file = new File("/Users/edy/Desktop/file1/1.txt");
        OutputStream os = null;

        try {
            os = new FileOutputStream(file.getAbsoluteFile(),true);
            String a = "我爱你";
            os.write(a.getBytes());

        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            IOUtils.closeQuietly(os);
        }


    }
}
